package com.xiao.asset.services;


import com.xiao.asset.bean.UserBean;
import com.xiao.asset.mapper.UserMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 衰草寒烟 on 2016/11/3.
 */
@Service("userservice")
public class UserService {
    @Autowired
    private UserMapper usermapper;
    /**
     * 登录验证
     */
    public UserBean login(String username, String password){
        UserBean result = usermapper.login(username);
        if(result!=null){
            if(StringUtils.equals(result.getUsername(),username) && StringUtils.equals(result.getPassword(),password)){
                return result;
            }
        }
        return null;
    }
}
